home *** CD-ROM | disk | FTP | other *** search
- Path: kuhub.cc.ukans.edu!anh
- From: anh@kuhub.cc.ukans.edu
- Newsgroups: comp.lang.c++
- Subject: How big is the 0
- Message-ID: <1996Feb17.132420.114207@kuhub.cc.ukans.edu>
- Date: 17 Feb 96 13:24:20 CST
- Organization: University of Kansas Academic Computing Services
-
-
- Hello,
-
- In C, anytime I need to do a null pointer check I would do this:
-
- MyType *p;
-
- if(p==(MyType*)0)
- bla;
-
- The new operator supposedly return a 0 upon failure. Can I rely on the
- compiler to make sure the 0 is as big as the size of the pointer? For
- example, ALPHA's pointers are 64 bits long which is different from the 32 bits
- int.
-
- Thank-you.
-
- Anh
-